package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.SeeRecordRequest;
import one.stand.response.CrmCustomerAnalysisRespnse;
import one.stand.response.CrmSeeRecordResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@RequestMapping("seeRecord")
@RestController
public class SeeRecordController extends BaseController {

    /**
     * 客户与我的互动
     *
     * @param request
     * @return
     */
    @PostMapping("customerAnalysis")
    public ResultModel<Map<String,Object>> customerAnalysis(@RequestBody SeeRecordRequest request) {
        return seeRecordService.customerAnalysis(request);
    }

    /**
     * 圆饼图
     *
     * @param request
     * @return
     */
    @PostMapping("countCustomerAnalysis")
    public ResultModel<List<CrmCustomerAnalysisRespnse>> countCustomerAnalysis(@RequestBody SeeRecordRequest request) {
        return seeRecordService.countCustomerAnalysis(request);
    }

    /**
     * 名片查看记录
     *
     * @param request
     * @return
     */
    @PostMapping("getSeeRecordList")
    public ResultModel<List<CrmSeeRecordResponse>> getSeeRecordList(@RequestBody SeeRecordRequest request) {
        return seeRecordService.getSeeRecordList(request);
    }

    /**
     * CRM-PC端首页统计
     *
     * @param request
     * @return
     */
    @PostMapping("getPcCount")
    public ResultModel<Map<String, Object>> getPcCount(@RequestBody SeeRecordRequest request) {
        return seeRecordService.getPcCount(request);
    }

    /**
     * CRM-PC端首页转化率漏斗
     *
     * @param request
     * @return
     */
    @PostMapping("getChangeCount")
    public ResultModel<Map<String, Object>> getChangeCount(@RequestBody SeeRecordRequest request) {
        return seeRecordService.getChangeCount(request);
    }
}
